# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-pycolorterm
_pkgname=pycolorterm
pkgver=0.2.1
# Corresponding release gitrev for tests, no tests in pypi package
_gitrev=35ce58d86b93aa14383b9be340de5146994bb7ce
pkgrel=6
pkgdesc="A Python module to work with color and style formatting"
url="https://github.com/dnmellen/pycolorterm"
arch="noarch"
license="BSD-3-Clause"
replaces="py-pycolorterm" # for backwards compatibility
provides="py-pycolorterm=$pkgver-r$pkgrel" # for backwards compatibility
subpackages="$pkgname-pyc"
depends="python3"
makedepends="py3-gpep517 py3-setuptools"
source="$pkgname-$_gitrev.tar.gz::https://github.com/dnmellen/pycolorterm/archive/$_gitrev.tar.gz
	assert-equal-tests.patch
	"
builddir="$srcdir/$_pkgname-$_gitrev"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest -b
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" .dist/*.whl
}

sha512sums="
77a88fd51c9b44432fe62216a9462c8c811fae1fea48c28b224ecac4256c8f19b25b8da2afe3bbe192ee0bc3baf4e6dc4a24c899dacbc5859ad3e31264f02038  py3-pycolorterm-35ce58d86b93aa14383b9be340de5146994bb7ce.tar.gz
46b8c7df22bbb17418909fc728b7db793dd745ab7cf6cca2e77a20e6df6ac549769fac6389e0c9ecabc025fe8d6a9ac4285ed9a49e65f8d644e7095914e11b7f  assert-equal-tests.patch
"
